package cn.cheln.explorer.funcgroup;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import cn.cheln.explorer.func.setup.InstallHelper;
import cn.cheln.explorer.func.setup.PackageInstallManager;
import java.util.Comparator;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class AppSrc
{
  private static Map<String, String> packagesVersion = new TreeMap(new Comparator()
  {
    public int compare(String paramString1, String paramString2)
    {
      if (paramString1 == null)
        return 0;
      return paramString1.compareTo(paramString2);
    }
  });

  public static Map<String, String> getPackagesVersion()
  {
    return packagesVersion;
  }

  public static void initInstalledApps(Context paramContext)
  {
    initInstalledApps(paramContext, true);
  }

  public static void initInstalledApps(Context paramContext, boolean paramBoolean)
  {
    if (paramBoolean)
      packagesVersion.clear();
    Iterator localIterator = paramContext.getPackageManager().getInstalledPackages(0).iterator();
    while (true)
    {
      if (!(localIterator.hasNext()))
      {
        PackageInstallManager.getInstance();
        if (PackageInstallManager.isInInstall)
          packagesVersion.putAll(PackageInstallManager.getInstance().pi.pkgRenaming);
        return;
      }
      PackageInfo localPackageInfo = (PackageInfo)localIterator.next();
      packagesVersion.put(localPackageInfo.packageName, localPackageInfo.versionName);
    }
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.funcgroup.AppSrc
 * JD-Core Version:    0.5.2
 */